bl_info = {
    "name": "My Node System",
    "author": "karrycharon FPTX(会飞的键盘侠)",
    "version": (1, 1, 0),
    "blender": (2, 93, 0),
    "category": "Node"
}

import bpy
from bpy.types import NodeTree
from .nodes import nodecls
from nodeitems_utils import NodeCategory, NodeItem, register_node_categories, unregister_node_categories


class My_nodeTree(NodeTree):
    bl_idname = 'my_nodetree'
    bl_label = 'My Node'
    bl_icon = 'NODETREE'
    display_shape = {"CIRCLE"}


class MyNodeCategory(NodeCategory):
    @classmethod
    def poll(cls, context):
        return context.space_data.tree_type == 'my_nodetree'


node_cat = [
    MyNodeCategory('MYNODES', "Nodes", items=[
        NodeItem("Node_Object"),
        NodeItem("Node_Collection"),
    ]),
]

clss = [My_nodeTree, ]
clss.extend(nodecls)

def register():
    for c in clss:
        bpy.utils.register_class(c)
    register_node_categories('MYNODES_SYS', node_cat)


def unregister():
    unregister_node_categories('MYNODES_SYS')
    for c in clss:
        bpy.utils.unregister_class(c)
